﻿namespace MicroCloud.Builders
{
    /// <summary>
    /// 系统构建器接口
    /// </summary>
    public interface IMicroCloudBuilder
    {
        #region 属性
        /// <summary>
        /// 获取 服务集合
        /// </summary>
        IServiceCollection Services { get; }

        /// <summary>
        /// 获取 加载的模块集合
        /// </summary>
        IEnumerable<PackBase> Packs { get; }

        /// <summary>
        /// 获取 MicroCloud配置信息
        /// </summary>
        MicroCloudOptions Options { get; }

        #endregion

        #region 方法
        /// <summary>
        /// 加载指定模块
        /// </summary>
        /// <param name="type">模块类型</param>
        /// <returns>系统构建器</returns>
        IMicroCloudBuilder AddPack(Type type);

        /// <summary>
        /// 加载指定模块
        /// </summary>
        /// <typeparam name="TPack">要加载的模块类型</typeparam>
        /// <returns>系统构建器</returns>
        IMicroCloudBuilder AddPack<TPack>() where TPack : PackBase;

        /// <summary>
        /// 加载所有模块(可排除指定类型的模块)
        /// </summary>
        /// <param name="exceptPackTypes">要排除的模块类型</param>
        /// <returns>系统构建器</returns>
        IMicroCloudBuilder AddPacks(params Type[] exceptPackTypes);

        #endregion
    }
}